package com.yanti.domain.enums;

public enum RedisKeyEnum {
//    TEMPORARY_QUESTION_TIME("temporary_question_time:%s:%s"),
    TEMPORARY_QUESTION_TIME("temp_question_time:%s:%s"),

    TODAY_TEMPORARY_COUNT("today_temporary_count:%s"),
    CHAT_HISTORY_KEY_PREFIX("chat:history:");

    private final String keyFormat;

    RedisKeyEnum(String keyFormat) {
        this.keyFormat = keyFormat;
    }
    /**
     * 根据传入的参数格式化键
     *
     * @param params 参数数组
     * @return 格式化后的键
     */
    public String getKey(Object... params) {
        return String.format(keyFormat, params);
    }
}
